﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NicoView.Model.Share.Speech.Learn
{
    public class LearnDictionary : Dictionary<string, Learnword>
    {
        public new void Add(string key, Learnword word)
        {
            base.Add(key, word);


        }

        public void Set(ICollection<Learnword> words)
        {
            foreach (var word in words)
            {
                base.Add(word.Key, word);

            }

        }

        public virtual string Replace(string text)
        {
            foreach (var learn in this.Values)
            {
                text = text.Replace(learn.Key, learn.Text);
            }

            return text;
        }

        public new void Remove(string key)
        {
            base.Remove(key);

        }

    }
}
